<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pushStat</title>
<script src="../lib/jquery/jquery.js"></script>
</head>

<body>
<a href="#/a1/b/c#a=3">test1</a>
<a href="#/a2/b/c">test2</a>
<a href="#/a3/b/c">test3</a>

<script type="text/javascript">
  function parseUrl( url ){
			var urlParseRE = /^\s*(((([^:\/#\?]+:)?(?:(\/\/)((?:(([^:@\/#\?]+)(?:\:([^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((\/?(?:[^\/\?#]+\/+)*)([^\?#]*)))?(\?[^#]+)?)(#.*)?/;	
			if ( $.type( url ) === "object" ) {
				return url;
			}
			var matches = urlParseRE.exec( url || "" ) || [];
			return {
				href:         matches[  0 ] || "",
				hrefNoHash:   matches[  1 ] || "",
				hrefNoSearch: matches[  2 ] || "",
				domain:       matches[  3 ] || "",
				protocol:     matches[  4 ] || "",
				doubleSlash:  matches[  5 ] || "",
				authority:    matches[  6 ] || "",
				username:     matches[  8 ] || "",
				password:     matches[  9 ] || "",
				host:         matches[ 10 ] || "",
				hostname:     matches[ 11 ] || "",
				port:         matches[ 12 ] || "",
				pathname:     matches[ 13 ] || "",
				directory:    matches[ 14 ] || "",
				filename:     matches[ 15 ] || "",
				search:       matches[ 16 ] || "",
				hash:         matches[ 17 ] || ""
			};
		}
$(function(){
$(document).on('click', function(e){
	var elm = $(e.target);
	var absHref = elm.prop('href');
      // get the actual href attribute - see
      // http://msdn.microsoft.com/en-us/library/ie/dd347148(v=vs.85).aspx
    var relHref = elm.attr('href') || elm.attr('xlink:href');
	
	console.log(absHref, relHref, '---');
	
	var url = relHref.slice(1);
	
	var state = {
        title: 1,
        url: url,
        otherkey: 1
	};
	
	//window.history.pushState(state, document.title, url);
	
	//e.preventDefault();
});

$(window).on('popstate', function(e){
	console.log('xxx', history.state)	
})

})

</script>
</body>
</html>
